#!$PREFIX/bin/bash
#=============================================================
# https://gitee.com/wuxuanmu/termux
# Doc: https://gitee.com/wuxuanmu/termux/README.md
# Description: Termux one key remote control script (monitoring)
# Environment Required: Android with the latest Termux.
# Version number：3.1
# by：轩沐
#=============================================================
sh_ver="2.9.1"
frpc="termux/frp_0.34.1_linux_arm/frpc.ini"
Green_font_prefix="\033[32m"
Red_font_prefix="\033[31m"
Green_background_prefix="\033[42;37m"
Red_background_prefix="\033[41;37m"
Font_color_suffix="\033[0m"
Info="[${Green_font_prefix}信息${Font_color_suffix}]"
Error="[${Red_font_prefix}错误${Font_color_suffix}]"
Tip="[${Green_font_prefix}注意${Font_color_suffix}]"

xuanmu(){

echo && echo -e "\n\n	欢迎使用 Termux-RC 一键安装管理脚本 ${Red_font_prefix}[v${sh_ver}]${Font_color_suffix}\n
 ${Green_font_prefix} 1.${Font_color_suffix} 一键全自动安装（默认安装，新手推荐）
 ${Green_font_prefix} 2.${Font_color_suffix} 手动选择性安装（推荐有一定基础的人使用）
 ${Green_font_prefix} 任意键默认安装${Font_color_suffix} 
 ———————————————————————
使用介绍及教程：https://gitee.com/wuxuanmu/termux/
 ———————————————————————" && echo
 echo -en " 请输入数字:"
	read num
case "$num" in
1)
	AutomaticInstallation
    ;;
2)
	ManualInstallation
    ;;
*)
    AutomaticInstallation
    ;;
esac
 }

AutomaticInstallation(){
for i in {1..1}
do
A=`head -c 500 /dev/urandom | tr -dc a-zA-Z | tr [a-z] [A-Z]|head -c 1`
B=`head -c 500 /dev/urandom | tr -dc a-z0-9A-Z | head -c 6`
C=`echo $RANDOM|cut -c 2`
done

 echo -en "\n${Info}即将申请访问存储权限，请授权！（倒计时三秒，如果未授权，请至手机设置-应用管理-权限管理，进行手动开启，如不开启，则无法访问手机内存根目录文件！）\n"
 sleep 2
 termux-setup-storage
 ln -s /storage/emulated/0/ storage
echo -en "\n${Green_font_prefix} 使用说明：https://gitee.com/wuxuanmu/termux/README.md ${Font_color_suffix}\n"
echo -en "\n${Green_font_prefix} 请访问 http://18.179.62.200:7500/ 进行查看空缺端口，谢谢！${Font_color_suffix}\n"
read -e -p " 请设置SSH远程连接端口号: " sshport
read -e -p " 请设置SSH远程连接密码: " sshpasswd
#read -e -p " 请输入WEB文件管理器端口号: " kodport
clear
 echo -en "\n${Info}全部设置成功，即将进入极速搭建！（倒计时三秒）\n"
 sleep 2

#ssh
 cd
 cd termux/
#wget http://static.kodcloud.com/update/download/kodexplorer4.40.zip
unzip 1.zip -d $PREFIX/share/nginx/html/kod
unzip 2.zip -d $PREFIX/share/nginx/html/kod
chmod -R 777 frp_0.34.1_linux_arm
cd 
kodfrpcconf=$(echo "\n\n[$C$B$A]\ntype = tcp\nlocal_ip = 127.0.0.1\nlocal_port = 8080\nremote_port = ${kodport}\n\n" | sed 's/\//\\\//g')
kill -9 `pgrep frpc`
sed -i "s@^\(#KodExplorer\).*@\1${kodfrpcconf}@" ${frpc}
cd 
cd termux/frp_0.34.1_linux_arm
./frpc -c ./frpc.ini>/dev/null 2>&1 &
  sed -i "s@^\(listen = \).*@\1$(echo "127.0.0.1:9000" | sed 's/\//\\\//g')@" $PREFIX/etc/php-fpm.d/www.conf
  sed -i "s@^\(            index  index.html index.htm\).*@\1$(echo " index.php;" | sed 's/\//\\\//g')@" $PREFIX/etc/nginx/nginx.conf
  sed -i "s@^\(        # pass the PHP\).*@\1$(echo "\nlocation ~ \.php\$ {\n#1\n" | sed 's/\//\\\//g')@" $PREFIX/etc/nginx/nginx.conf
  sed -i "s@^\(#1\).*@\1$(echo "\nroot           html;\n#2\n" | sed 's/\//\\\//g')@" $PREFIX/etc/nginx/nginx.conf
  sed -i "s@^\(#2\).*@\1$(echo "\nfastcgi_pass   127.0.0.1:9000;\n#3\n" | sed 's/\//\\\//g')@" $PREFIX/etc/nginx/nginx.conf
  sed -i "s@^\(#3\).*@\1$(echo "\nfastcgi_index  index.php;\n#4\n" | sed 's/\//\\\//g')@" $PREFIX/etc/nginx/nginx.conf
  sed -i "s@^\(#4\).*@\1$(echo "\nfastcgi_param  SCRIPT_FILENAME  /data/data/com.termux/files/usr/share/nginx/html\$fastcgi_script_name;\n#5\n" | sed 's/\//\\\//g')@" $PREFIX/etc/nginx/nginx.conf
  sed -i "s@^\(#5\).*@\1$(echo "\ninclude        fastcgi_params;\n#6\n" | sed 's/\//\\\//g')@" $PREFIX/etc/nginx/nginx.conf
  sed -i "s@^\(#6\).*@\1$(echo "\n}\n" | sed 's/\//\\\//g')@" $PREFIX/etc/nginx/nginx.conf
 php-fpm
 nginx
 nginx -s reload
echo "nginx" >> ~/.bashrc
echo "php-fpm" >> ~/.bashrc
#web
cd
cd termux/
chmod -R 777 frp_0.34.1_linux_arm
cd 
sshfrpcconf=$(echo "\n\n[$A$B$C]\ntype = tcp\nlocal_ip = 127.0.0.1\nlocal_port = 8022\nremote_port = ${sshport}\n\n" | sed 's/\//\\\//g')
kill -9 `pgrep frpc`
sed -i "s@^\(#SSH\).*@\1${sshfrpcconf}@" ${frpc}
cd 
sshd
cd termux/frp_0.34.1_linux_arm
./frpc -c ./frpc.ini>/dev/null 2>&1 &
ifconfig=$(ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:")
echo -e "${sshpasswd}\n${sshpasswd}" | passwd --stdin
echo "sshd" >> ~/.bashrc
echo "./termux/frp_0.34.1_linux_arm/frpc -c ./termux/frp_0.34.1_linux_arm/frpc.ini>/dev/null 2>&1 &" >> ~/.bashrc
cd 

clear

echo && echo -e "\n\n	欢迎使用 Termux-RC 一键安装管理脚本 ${Red_font_prefix}[v${sh_ver}]${Font_color_suffix}\n"

echo -en "\n${Info}远控安装成功\n"
echo -en "\n${Info}已添加开机自启\n"
echo -en "\n${Info}用户名:
$ifconfig\n"
echo -en "\n${Info}远程连接命令：ssh 用户名其中一个@18.179.62.200 -p ${sshport}\n"
echo -en "\n${Info}WEB文件管理器访问地址：http://18.179.62.200:${kodport}/kod/\n"
echo -en "\n${Info}一键操控远程设备(请先进行远程连接)：bash termux/Firmware.sh\n"
exit
}


ManualInstallation(){
    clear 
echo && echo -e "\n\n	欢迎使用 Termux-RC 一键安装管理脚本 ${Red_font_prefix}[v${sh_ver}]${Font_color_suffix}\n
 ${Green_font_prefix} 1.${Font_color_suffix} 一键安装远控（OpenSSH＋Frpc）
 ${Green_font_prefix} 2.${Font_color_suffix} 一键安装web可视化管理器（KodExplorer）
 ${Green_font_prefix} 3.${Font_color_suffix} 一键调用手机各种固件
 ${Green_font_prefix} 4.${Font_color_suffix} 一键安装Metasploit脚本（M-wiz）
 ${Green_font_prefix} 5.${Font_color_suffix} 一键内网端口映射到外网（Frp）
 ${Green_font_prefix} 6.${Font_color_suffix} 一键安装各种系统（国光）
 ${Green_font_prefix} 任意键退出脚本${Font_color_suffix} 
 ———————————————————————
使用教程：https://gitee.com/wuxuanmu/termux/
 ———————————————————————" && echo
 echo -en " 请输入数字 [1-6]:"
read num
case "$num" in
0)
    exit 0
    ;;
1)
    Install_Remotecontrol
    ;;
2)
    Install_KodExplorer
    ;;
3)
    clear
    Firmware
    ;;
4)
    Install_Metasploit
    ;;
5)
    Install_Frpc
    ;;
6)
    Install_Sqlsec
    ;;
*)
    echo
    echo -e " ${Error} 请输入正确的数字"
    ;;
esac
}

Set_source() {
sed -i 's@^\(deb.*stable main\)$@\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/termux-packages-24 stable main@' $PREFIX/etc/apt/sources.list
sed -i 's@^\(deb.*games stable\)$@\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/game-packages-24 games stable@' $PREFIX/etc/apt/sources.list.d/game.list
sed -i 's@^\(deb.*science stable\)$@\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/science-packages-24 science stable@' $PREFIX/etc/apt/sources.list.d/science.list
clear
echo -e "${Info} 镜像源配置成功"
pkg undate -y
pkg install tree proot vim termux-api unzip wget sl -y
echo -e "${Info} 系统环境更新成功"
clear
sl
xuanmu
}

Install_Remotecontrol() {
clear
chmod -R 777 frp_0.34.1_linux_arm
clear
echo -en "\n${Green_font_prefix} 请访问 http://18.179.62.200:7500/ 进行查看空缺ID及端口，谢谢！${Font_color_suffix}\n"
read -e -p " 请输入ID: " sshcid
read -e -p " 请输入端口号: " sshport
cd 
sshfrpcconf=$(echo "\n\n[${sshcid}]\ntype = tcp\nlocal_ip = 127.0.0.1\nlocal_port = 8022\nremote_port = ${sshport}\n\n" | sed 's/\//\\\//g')
kill -9 `pgrep frpc`
sed -i "s@^\(#SSH\).*@\1${sshfrpcconf}@" ${frpc}
cd 
sshd
cd termux/frp_0.34.1_linux_arm
./frpc -c ./frpc.ini>/dev/null 2>&1 &
clear
echo -en "\n${Green_font_prefix} 远控安装成功${Font_color_suffix}\n"

ifconfig=$(ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:")
echo -en "\n${Green_font_prefix} 使用说明：https://gitee.com/wuxuanmu/termux/README.md ${Font_color_suffix}\n"

echo -en "\n${Info}用户名：
$ifconfig"
echo -en "\n${Info}远程连接命令：ssh 用户名其中一个@18.179.62.200 -p ${sshport}"
php-fpm
read -e -p " 请设置SSH远程连接密码: " sshpasswd
echo -e "${sshpasswd}\n${sshpasswd}" | passwd --stdin

echo "sshd" >> ~/.bashrc
echo "./termux/frp_0.34.1_linux_arm/frpc -c ./termux/frp_0.34.1_linux_arm/frpc.ini>/dev/null 2>&1 &" >> ~/.bashrc
echo -en "\n${Info}已添加开机自启\n"
xuanmu
}

#Install_KodExplorer(){
 cd
 cd termux/
#wget http://static.kodcloud.com/update/download/kodexplorer4.40.zip
unzip 1.zip -d $PREFIX/share/nginx/html/kod
unzip 2.zip -d $PREFIX/share/nginx/html/kod
chmod -R 777 frp_0.34.1_linux_arm
clear
echo -en "\n${Green_font_prefix} 请访问 http://18.179.62.200:7500/ 进行查看空缺ID及端口，谢谢！${Font_color_suffix}\n"
read -e -p " 请输入ID: " kodid
read -e -p " 请输入端口号: " kodport
cd 
kodfrpcconf=$(echo "\n\n[${kodid}]\ntype = tcp\nlocal_ip = 127.0.0.1\nlocal_port = 8080\nremote_port = ${kodport}\n\n" | sed 's/\//\\\//g')
kill -9 `pgrep frpc`
sed -i "s@^\(#KodExplorer\).*@\1${kodfrpcconf}@" ${frpc}
cd 
cd termux/frp_0.34.1_linux_arm
./frpc -c ./frpc.ini>/dev/null 2>&1 &
clear
echo -en "\n${Green_font_prefix} 已开启远程访问：${Font_color_suffix}http://18.179.62.200:${kodport}/kod/\n"

 echo -en "\n${Info}即将申请访问存储权限，请授权！（倒计时三秒）\n"
 sleep 2
 termux-setup-storage
  sed -i "s@^\(listen = \).*@\1$(echo "127.0.0.1:9000" | sed 's/\//\\\//g')@" $PREFIX/etc/php-fpm.d/www.conf
  sed -i "s@^\(            index  index.html index.htm\).*@\1$(echo " index.php;" | sed 's/\//\\\//g')@" $PREFIX/etc/nginx/nginx.conf
  sed -i "s@^\(        # pass the PHP\).*@\1$(echo "\nlocation ~ \.php\$ {\n#1\n" | sed 's/\//\\\//g')@" $PREFIX/etc/nginx/nginx.conf
  sed -i "s@^\(#1\).*@\1$(echo "\nroot           html;\n#2\n" | sed 's/\//\\\//g')@" $PREFIX/etc/nginx/nginx.conf
  sed -i "s@^\(#2\).*@\1$(echo "\nfastcgi_pass   127.0.0.1:9000;\n#3\n" | sed 's/\//\\\//g')@" $PREFIX/etc/nginx/nginx.conf
  sed -i "s@^\(#3\).*@\1$(echo "\nfastcgi_index  index.php;\n#4\n" | sed 's/\//\\\//g')@" $PREFIX/etc/nginx/nginx.conf
  sed -i "s@^\(#4\).*@\1$(echo "\nfastcgi_param  SCRIPT_FILENAME  /data/data/com.termux/files/usr/share/nginx/html\$fastcgi_script_name;\n#5\n" | sed 's/\//\\\//g')@" $PREFIX/etc/nginx/nginx.conf
  sed -i "s@^\(#5\).*@\1$(echo "\ninclude        fastcgi_params;\n#6\n" | sed 's/\//\\\//g')@" $PREFIX/etc/nginx/nginx.conf
  sed -i "s@^\(#6\).*@\1$(echo "\n}\n" | sed 's/\//\\\//g')@" $PREFIX/etc/nginx/nginx.conf
sheep 2
 php-fpm
 nginx
 nginx -s reload

echo "nginx" >> ~/.bashrc
echo "php-fpm" >> ~/.bashrc
echo "./termux/frp_0.34.1_linux_arm/frpc -c ./termux/frp_0.34.1_linux_arm/frpc.ini>/dev/null 2>&1 &" >> ~/.bashrc
echo -en "\n${Info}已添加开机自启\n"
}

Install_Metasploit(){

apt-get update -y
apt-get upgrade -y
pkg install python -y
pkg install python2 -y
pkg install git -y
pip install lolcat
git clone https://github.com/noob-hackers/m-wiz
cd m-wiz
bash m-wiz.sh

}

Install_Sqlsec(){
pkg install git python proot -y
git clone https://github.com/sqlsec/termux-install-linux
cd termux-install-linux
python termux-linux-install.py

}


Install_Frpc(){
 cd
cd termux/
chmod -R 777 frp_0.34.1_linux_arm
clear
echo -en "\n${Green_font_prefix} 请访问 http://18.179.62.200:7500/ 进行查看空缺ID及端口，谢谢！${Font_color_suffix}\n"
read -e -p " 请输入ID: " frpcid
read -e -p " 请输入本地端口号: " localport
read -e -p " 请输入面板端口号: " frpcport
cd 
kodcconf=$(echo "\n\n[${frpcid}]\ntype = tcp\nlocal_ip = 127.0.0.1\nlocal_port = ${localport}\nremote_port = ${frpcport}\n\n" | sed 's/\//\\\//g')
kill -9 `pgrep frpc`
sed -i "s@^\(#KodExplorer\).*@\1${kodcconf}@" ${frpc}
cd 
cd termux/frp_0.34.1_linux_arm
./frpc -c ./frpc.ini>/dev/null 2>&1 &

}

Firmware(){
echo && echo -e "\n\n	欢迎使用 Termux-RC 一键安装管理脚本 ${Red_font_prefix}[v${sh_ver}]${Font_color_suffix}\n
 ${Green_font_prefix} 1.${Font_color_suffix} 拍照 ${Green_font_prefix}             11.${Font_color_suffix} WiFi管理
 ${Green_font_prefix} 2.${Font_color_suffix} 定位 ${Green_font_prefix}             12.${Font_color_suffix} 查看电量
 ${Green_font_prefix} 3.${Font_color_suffix} 录音 ${Green_font_prefix}             13.${Font_color_suffix} 调用语音引擎进行讲话
 ${Green_font_prefix} 4.${Font_color_suffix} 拨打电话 ${Green_font_prefix}         14.${Font_color_suffix} 制作二维码
 ${Green_font_prefix} 5.${Font_color_suffix} 查看通讯录 ${Green_font_prefix}       15.${Font_color_suffix} 调用指纹传感器
 ${Green_font_prefix} 6.${Font_color_suffix} 震动手机 ${Green_font_prefix}         16.${Font_color_suffix} 调用下载
 ${Green_font_prefix} 7.${Font_color_suffix} 开关闪光灯 ${Green_font_prefix}       17.${Font_color_suffix} 调用剪切板
 ${Green_font_prefix} 8.${Font_color_suffix} 发送弹窗 ${Green_font_prefix}         18.${Font_color_suffix} 查看手机运营商信息
 ${Green_font_prefix} 9.${Font_color_suffix} 播放媒体 ${Green_font_prefix}         19.${Font_color_suffix} 查看无线电信息
 ${Green_font_prefix} 10.${Font_color_suffix} 更换手机壁纸 ${Green_font_prefix}    20.${Font_color_suffix} 调用 USB 设备
 ${Green_font_prefix} 21.${Font_color_suffix} 调整屏幕亮度

 ${Green_font_prefix} 任意键退出.${Font_color_suffix}
 ———————————————————————
使用教程：https://gitee.com/wuxuanmu/termux/
 ———————————————————————" && echo
 echo -en " 请输入数字 [1-21]:"
read num
case "$num" in
1)
    TakePhotos
    ;;
2)
    Location
    ;;
3)
    Srecord
    ;;
4)
    Call
    ;;
5)
    Contact
    ;;
6)
    Vibrate
    ;;
7)
    Torch
    ;;
8)
    Ification
    ;;
9)
    Media
    ;;
10)
    Wallpaper
    ;;
11)
    WiFi
    ;;
12)
    Battery
    ;;
13)
    Speak
    ;;
14)
    Qrenco
    ;;
15)
    Fingerprint
    ;;
16)
    Download
    ;;
17)
    Clipboard
    ;;
18)
    Deviceinfo
    ;;
19)
    Cellinfo
    ;;
20)
    USB
    ;;
21)
    Brightness
    ;;
*)
    echo
    clear
    ManualInstallation
    ;;
esac
}

TakePhotos(){

 echo && echo -e "
1. 前摄拍照
2. 后摄拍照
任意键退出" && echo
 echo -en " 请输入数字:"
	read num
	read -e -p " 请输入照片名字: " TakePhotosName
case "$num" in
1)
    termux-camera-photo -c 1 ${TakePhotosName}.jpg
	echo -e " ${Info} 拍照成功，请登录KodExplorer管理器查看！"
	TakePhotos
    ;;
2)
    termux-camera-photo -c 0 ${TakePhotosName}.jpg
	echo -e " ${Info} 拍照成功，请登录KodExplorer管理器查看！"
	TakePhotos
    ;;
*)
    Firmware
    ;;
esac
}

Location(){
 echo && echo -e "
请选择定位方式：
1. GPS定位
2. 网络定位
任意键退出" && echo
 echo -en " 请输入数字:"
	read num
case "$num" in
1)
    latitude=`termux-location |grep \t|grep -v altitude|grep -v provider|grep -v elapsedMs |grep -v longitude|grep -v bearing|grep -v speed|grep -v accuracy|grep -v vertical_accuracy|awk '{print $2}'`
    longitude=`termux-location |grep \t|grep -v altitude|grep -v provider|grep -v elapsedMs |grep -v latitude|grep -v bearing|grep -v speed|grep -v accuracy|grep -v vertical_accuracy|awk '{print $2}'`
	echo -e " ${Info} 定位成功，请复制到浏览器查看!"
	echo -e " ${Info} 地址：https://mo.amap.com/?q=${latitude}${longitude}"
	Location
    ;;
2)
    latitude=`termux-location -p network |grep \t|grep -v altitude|grep -v provider|grep -v elapsedMs |grep -v longitude|grep -v bearing|grep -v speed|grep -v accuracy|grep -v vertical_accuracy|awk '{print $2}'`
    longitude=`termux-location -p network |grep \t|grep -v altitude|grep -v provider|grep -v elapsedMs |grep -v latitude|grep -v bearing|grep -v speed|grep -v accuracy|grep -v vertical_accuracy|awk '{print $2}'`
	echo -e " ${Info} 定位成功，请复制到浏览器查看!"
	echo -e " ${Info} 地址：https://mo.amap.com/?q=${latitude}${longitude}"
	Location
	;;
*)
    Firmware
    ;;
esac
}

Srecord(){
 echo && echo -e "
1. 开始录音
2. 停止录音
3. 查看正在录音的进程
任意键退出录音功能" && echo
 echo -en " 请输入数字:"
	read num
case "$num" in
1)
	read -e -p " 请输入录音时间（以秒为单位，无限制为0）: " SrecordTime
	read -e -p " 请输入录音名称: " SrecordName
	termux-microphone-record -l ${SrecordTime} -f /storage/emulated/0/${SrecordName}.m4a
	echo -e " ${Info} 开启录音成功，请至KodExplorer管理器查看！"
	Srecord
    ;;
2)
    termux-microphone-record -q
	echo -e " ${Info} 停止录音成功"
	Srecord
    ;;
3)
    termux-microphone-record -i
	Srecord
    ;;
*)
    Firmware
    ;;
esac
 }

Call(){
	read -e -p " 请输入号码: " CallName
	termux-telephony-call ${CallName}
	Firmware
 }

Contact(){
	termux-contact-list 
	Firmware 
 }

Vibrate(){
	read -e -p " 请输入震动时长（毫秒单位）: " VibrateTime
	termux-vibrate -f -d ${VibrateTime}
	Firmware
}

Torch(){
 echo && echo -e "
1. 开启闪光灯
2. 关闭闪光灯
任意键退出" && echo
 echo -en " 请输入数字:"
	read num
case "$num" in
1)
	termux-torch on
	Torch
    ;;
2)
	termux-torch off
	Torch
    ;;
*)
    Firmware
    ;;
esac
 }

Ification(){
 echo && echo -e "
1. 通知栏弹窗
2. 界面弹窗
3. 互交弹窗
任意键退出弹窗功能" && echo
 echo -en " 请输入数字:"
	read num
case "$num" in
1)
	read -e -p " 请输入标题: " NoticeTitle
	read -e -p " 请输入内容: " NoticeContent
	termux-notification -t "${NoticeTitle}" -c "${NoticeContent}" --type default
	Ification
    ;;
2) 
	read -e -p " 请输入内容: " PopUpContent
	read -e -p " 弹窗颜色: " PopUpColor
	read -e -p " 字体颜色: " PopUpContentColor
	termux-toast -b ${PopUpColor} -c ${PopUpContentColor} ${PopUpContent}
	Ification
    ;;
3)
	read -e -p " 请输入标题: " ConfirmTitle
	read -e -p " 请输入内容: " ConfirmContent
    termux-dialog confirm -i "${ConfirmContent}" -t "${ConfirmTitle}"
	echo -e " ${Info} 互交弹窗功能不仅仅是这么简单，如果想了解更多请发送 termux-dialog -h 具体查看"
	Ification
    ;;
*)
    Firmware
    ;;
esac
 }

Media(){
 echo && echo -e "
1. 播放视频
2. 退出播放
3. 查看当前播放进程
按任意键退出" && echo
 echo -en " 请输入数字:"
	read num
case "$num" in
1)
	read -e -p " 请输入想播放文件的路径（例如想播放内存根目录下的test.mp4文件：/storage/emulated/0/test.mp4）: " MediaFile
	termux-media-player play ${MediaFile}
	Media
    ;;
2)
    termux-media-player stop
	Media
	;;
3)
    termux-media-player info
	Media
    ;;
*)
    Firmware
    ;;
esac
}

Wallpaper(){
 echo && echo -e "
1. 将 file 文件设为壁纸
2. 从 URL 中获取壁纸
3. 为锁屏设置壁纸
任意键退出录音功能" && echo
 echo -en " 请输入数字:"
	read num
case "$num" in
1)
	read -e -p " 请输入文件路径: " WallpaperFile
	termux-wallpaper -f ${WallpaperFile}
	Wallpaper
    ;;
2)
	read -e -p " 请输入URL路径: " WallpaperURL
	termux-wallpaper -u ${WallpaperURL}
	Wallpaper
    ;;
3)
    termux-microphone-record -i
	Wallpaper
    ;;
*)
    Firmware
    ;;
esac
 }

WiFi(){
 echo && echo -e "
1. 开启WiFi
2. 关闭WiFi
3. 查看当前连接信息
4. 查看WiFi扫描信息
任意键退出" && echo
 echo -en " 请输入数字:"
	read num
case "$num" in
1)
	termux-wifi-enable true
	WiFi
    ;;
2)
	termux-wifi-enable false
	WiFi
    ;;
3)
	termux-wifi-connectioninfo
	WiFi
    ;;
4)
	termux-wifi-scaninfo
	WiFi
    ;;
*)
    Firmware
    ;;
esac
 }

Battery(){
	termux-battery-status
	Firmware
 }

Speak(){
 echo && echo -e "
1. 查看语音引擎信息
2. 调用语音引擎讲话（更多用法请发送 termux-tts-speak -h 查看）
任意键退出" && echo
 echo -en " 请输入数字:"
	read num
case "$num" in
1)
	termux-tts-engines |grep name
	Speak
    ;;
2)
	read -e -p " 请输入要说的话: " SpeakInfo
	termux-tts-speak "${SpeakInfo}"
	Speak
    ;;
*)
    Firmware
    ;;
esac
 }

Qrenco(){
	read -e -p " 请输入文字或网址: " QrencoDe
	echo "${QrencoDe}" |curl -F-=\<- qrenco.de
	Firmware
 }

Fingerprint(){
	termux-fingerprint
	Firmware
 }
 
Download(){
	read -e -p " 请输入下载名称: " DownloadTitle
	read -e -p " 请输入文字描述: " DownloadDescribe
	read -e -p " 请输入下载连接: " DownloadURL
	termux-download -d "${DownloadDescribe}" -t "${DownloadTitle}" "${DownloadURL}"
	Firmware
 }
 
Clipboard(){
 echo && echo -e "
1. 查看当前剪贴板内容
2. 设置新的剪贴板内容
任意键退出" && echo
 echo -en " 请输入数字:"
	read num
case "$num" in
1)
	termux-clipboard-get
	Clipboard
    ;;
2)
	read -e -p " 请输入新的剪切板内容: " ClipboardDescribe
	termux-clipboard-set ${ClipboardDescribe}
	Clipboard
    ;;
*)
    Firmware
    ;;
esac
 }
 
Deviceinfo(){
	termux-telephony-deviceinfo
	Firmware
 }
 
Cellinfo(){
	termux-telephony-cellinfo
	Firmware
 }
 
USB(){
	pkg install termux-api libusb clang -y
	echo -e " ${Info} 调用USB接口玩法很多，这里就不扩展了（菜是原罪），如果想了解更多请发送 termux-usb -h 具体查看"
	termux-usb -l
	Firmware
 }

WiFiConf(){
	termux-wifi-connectioninfo
	Firmware
 }

Brightness(){
	read -e -p " 调整亮度值（0~255）" BrightnessNB
	termux-brightness ${BrightnessNB}
	Firmware
 }

rm -rf SetSource.sh
clear
sl
clear
xuanmu
